<?php 
	if(isset($error))
	{
		echo "<p style='text-align:center; padding: 5px; font-weight: bold'>".$error."</p>";
	}
	
?>

<form action="<?php echo base_url().'admin/members/update_members/'.$uid;?>" method="post" enctype="multipart/form-data">
<table class="class_table">
	<tr>
    	<td colspan="2"><h2 class="class_h2">Thay đổi thông tin cá nhân</h2></td>
    </tr>
	<tr>
    	<td>Họ và Tên</td>
        <td>
        <?php if(isset($result->fullname)) :?>
        <input type="text" name="txt_fullname" value="<?php echo $result->fullname;?>" />
        <?php else : ?>
        <input type="text" name="txt_fullname" value="<?php echo set_value('txt_fullname');?>" />
        <?php endif;?>
        </td>
    </tr>
    <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_fullname');?></td>
    </tr>
    <tr>
    	<td>Phân quyền</td>
        <td><select name="txt_level">
        	<option value="">---Chọn---</option>
        	<option value="1"<?php echo set_select('txt_level',1);?> <?php echo ($result->level == 1) ? "selected" : ""?>>Quản lý</option>
            <option value="2"<?php echo set_select('txt_level',2);?> <?php echo ($result->level == 2) ? "selected" : ""?>>Thông thường</option>
        </select></td>
    </tr>
    <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_level');?></td>
    </tr>
    <tr>
    	<td>Username</td>
        <td>
        <?php if(isset($result->username)) :?>
        <input type="text" name="txt_username" value="<?php echo $result->username;?>" />
        <?php else : ?>
        <input type="text" name="txt_username" value="<?php echo set_value('txt_username');?>" />
        <?php endif;?>
        </td>
    </tr>
    <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_username');?></td>
    </tr>
   
    <tr>
    	<td>Hình ảnh</td>
        <td>
       <img src="<?php echo base_url();?><?php echo $result->avarta;?>" width="100" height="100" />
       <?php if($result->avarta) {?>
       <input type="file" name="txt_file" value="<?php echo $result->avarta;?>" />
       <?php } else { ?>
       <input type="file" name="txt_file" value="<?php echo set_value('txt_file');?>" />
       <?php } ?>
        </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_file');?></td>
    </tr>
    <tr>
    	<td>Giới tính</td>
        <td>
        <select name="txt_gender">
        	<option value="">---Chọn---</option>
        	<option value="0"<?php echo set_select('txt_gender',0);?> <?php echo ($result->gender == 0) ? "selected" : ""?>>Nam</option>
            <option value="1"<?php echo set_select('txt_gender',1);?> <?php echo ($result->gender == 1) ? "selected" : ""?>>Nữ</option>
        </select>
        </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_gender');?></td>
    </tr>
     <tr>
    	<td>Ngày sinh</td>
        <td>
        <?php if(isset($result->birthday)) :?>
        <input type="text" name="txt_date" value="<?php echo $result->birthday;?>" />
        <?php else : ?>
         <input type="text" name="txt_date" value="<?php echo set_value('txt_date');?>" />
        <?php endif;?>
       (18/03/1991)</td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_date');?></td>
    </tr>
     <tr>
    	<td>Địa chỉ</td>
        <td>
        <?php if(isset($result->address)) :?>
        <input type="text" name="txt_address" value="<?php echo $result->address;?>" />
        <?php else : ?>
         <input type="text" name="txt_address" value="<?php echo set_value('txt_address');?>" />
        <?php endif;?>
       </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_address');?></td>
    </tr>
    <tr>
    	<td>Tỉnh/Thành phố</td>
        <td>
        <select name="txt_city">
        	<option value="" selected="selected">---Chọn---</option>
           <?php foreach($list_country as $row) {?>
           		<?php if($result->city == $row->id_country) { ?>
                <option value="<?php echo $row->id_country;?>" selected="selected"><?php echo $row->name_country?></option>                
                <?php } else {?>
                <option value="<?php echo $row->id_country;?>" selected="selected"><?php echo $row->name_country?></option> 
                <?php } ?>
           <?php }?>	
        	
           
        </select>
        </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_city');?></td>
    </tr>
    <tr>
    	<td>Số điện thoại</td>
        <td>
        <?php if(isset($result->phone)) {?>
        <input type="text" name="txt_phone" value="<?php echo $result->phone;?>" />
        <?php } else {?>
        <input type="text" name="txt_phone" value="<?php echo set_value('txt_phone');?>" />
        <?php } ?>
        </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_phone');?></td>
    </tr>
    <tr>
    	<td>Email</td>
        <td>
          <?php if(isset($result->email)) {?>
        <input type="text" name="txt_email" value="<?php echo $result->email;?>" />
        <?php } else {?>
        <input type="text" name="txt_email" value="<?php echo set_value('txt_email');?>" />
        <?php } ?>
        </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_email');?></td>
    </tr>
    <tr>
    	<td>Yahoo</td>
        <td>
         <?php if(isset($result->yahoo)) {?>
        <input type="text" name="txt_yahoo" value="<?php echo $result->yahoo;?>" />
        <?php } else {?>
        <input type="text" name="txt_yahoo" value="<?php echo set_value('txt_yahoo');?>" />
        <?php } ?>
        </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_yahoo');?></td>
    </tr>
     <tr>
    	<td>Skype</td>
        <td>
        <?php if(isset($result->skype)) {?>
        <input type="text" name="txt_skype" value="<?php echo $result->skype;?>" />
        <?php } else {?>
        <input type="text" name="txt_skype" value="<?php echo set_value('txt_skype');?>" />
        <?php } ?>
        </td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_skype');?></td>
    </tr>
    
    <tr>
    	<td>Thông tin</td>
        <td><textarea name="txt_info"><?php echo $result->info;?></textarea></td>
    </tr>
     <tr>
    	<td></td>
        <td style="color:#fff; font-weight:bold; background:red;"><?php echo form_error('txt_info');?></td>
    </tr>
    
    
    
    <tr>
    	<td><input type="hidden" name="image" value="<?php echo @$result->avarta;?>" />
        <input type="hidden" name="txt_uid" value="<?php echo @$result->id;?>" />
        </td>
        <td><input type="submit" name="submit" value="Submit" /></td>
    </tr>
</table>
</form>